home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
UTILITIE
/
CPU_MEMO
/
3468.ZIP
/
POPUP.ZIP
/
GETKEY.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-06-30
|
1KB
|
35 lines
include clink.inc
PUBLIC _getkey;
.CODE
;-----------------------------------------------------------------------------
; getkey() : Return next key press code. (As an INT)
;-----------------------------------------------------------------------------
; getkey() waits for a keypress, and then returns the code for that key.
; If it is an ordinary key, just the ASCII value is returned.
; If it is a special key (function key etc), the auxiliary byte is returned
; in the int, with bit 8 of the int set to indicate that it's a special key.
;-----------------------------------------------------------------------------
STARTPROC _getkey
mov ah, 0
int 16h ; Get key from BIOS
cmp al, 0
je Special ; Code 0 for special key
mov ah, 0 ; AL contains ASCII value
RETPROC
Special:
mov al, ah ; Special code into AL
mov ah, 1 ; Set "special" flag
RETPROC
_getkey ENDP
END